import 'package:finance_app/src/entities/employee_dot_entity.dart';

employeeDotEntityFromJson(EmployeeDotEntity data, Map<String, dynamic> json) {
	if (json['payroll'] != null) {
		data.payroll = json['payroll'] is String
				? int.tryParse(json['payroll'])
				: json['payroll'].toInt();
	}
	if (json['leave'] != null) {
		data.leave = json['leave'] is String
				? int.tryParse(json['leave'])
				: json['leave'].toInt();
	}
	if (json['reimburse'] != null) {
		data.reimburse = json['reimburse'] is String
				? int.tryParse(json['reimburse'])
				: json['reimburse'].toInt();
	}
	return data;
}

Map<String, dynamic> employeeDotEntityToJson(EmployeeDotEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['payroll'] = entity.payroll;
	data['leave'] = entity.leave;
	data['reimburse'] = entity.reimburse;
	return data;
}